package com.njym.java.security.app.mapper;

import com.njym.java.security.app.entity.FamilyUser;
import com.njym.java.security.app.entity.FamilyUserVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 
 * 
 * @author lijie
 * @email 717057076@qq.com
 * @date 2019-11-13 13:34:39
 */

public interface FamilyUserMapper extends Mapper<FamilyUser> {

    FamilyUser userInfo(@Param("mobile") String mobile);
    FamilyUser all(@Param("mobile") String mobile);
    /**
     * 查询好友
     * @param mobile
     * @return
     */
    List<FamilyUser> queryUser(@Param("mobile") String mobile);

    int insertFamilyUser(FamilyUser familyUser);

    void updateUserPoints(@Param("userId")Integer userId, @Param("point") Integer point);

    Integer getDailiCounts(@Param("name")String name);

    Integer getAllUserCounts();

    Integer getDailiUserCounts();

    List<FamilyUserVo> queryDaiLiRegister(@Param("index") int index, @Param("limit") Integer limit, @Param("name") String name);

    Integer countHasPay(@Param("generalizeCode") String generalizeCode);

    long countHasPay_2(@Param("baseId") String baseId, @Param("fuserId") String fuserId);

    long getTotal(@Param("generalizeCode") String generalizeCode, @Param("ids") Integer ids);

    long getTotal_2(@Param("baseId") String baseId, @Param("ids") Integer ids, @Param("generalizeCode") String generalizeCode);

    long getTotalPopular(@Param("ids") Integer ids, @Param("baseId") String baseId);

    List<FamilyUserVo> queryDaiLiUser(@Param("fuserId") String fuserId, @Param("id") Integer id,
        @Param("mobile") String mobile, @Param("start") String start, @Param("end") String end,
        @Param("order") Integer order, @Param("isPay") Integer isPay);

    List<FamilyUserVo> queryDaiLi(@Param("fuserId") String fuserId, @Param("id") Integer id, @Param("baseId") String baseId,
        @Param("mobile") String mobile, @Param("start") String start, @Param("end") String end,
        @Param("order") Integer order, @Param("isPay") Integer isPay);
}
